<!DOCTYPE HTML>
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>详情</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/css/uploadify.css">
    <link type="text/css" rel="stylesheet" href="/js/plugins/layer/laydate/skins/default/laydate.css" id="LayDateSkin">


</head>
<body>
<h2>{{if .update}}更新{{else}}添加{{end}}</h2>
<!--style给定宽度可以影响编辑器的最终宽度-->

<!--style给定宽度可以影响编辑器的最终宽度-->
<form id="FORM_validate" action="/messages/{{if .update}}update{{else}}add{{end}}" method="post">
    <input id="form_Id" type="hidden" value="{{if .update}}{{.Messages.Id}}{{end}}" name="{{if .update}}Id{{end}}">
    <div class="">
    	<div class="form-group col-md-12">
            <label class="col-md-3 control-label">接收时间：</label>
            <div class="col-md-9">
                <input placeholder="YYYY-MM-DD hh:mm:ss" name="messagestime"
                       value="{{if .update}}{{date .Messages.MessagesTime "Y-m-d H:i:s"}}{{end}}"
                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                       class="laydate-icon form-control layer-date"
                       required="" aria-required="true">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">发送者Id：</label>
            <div class="col-md-9">
                <input id="form_SendId" name="SendId" class="form-control" placeholder="请在此输入" value="{{if .update}}{{.Messages.SendId}}{{end}}">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">接收者Id：</label>
            <div class="col-md-9">
                <input id="form_ReceiveId" name="ReceiveId" class="form-control" placeholder="请在此输入" value="{{if .update}}{{.Messages.ReceiveId}}{{end}}">
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">消息类型：</label>
            <div class="col-md-9">
                <select class="form-control m-b" name="Type">
                    <option {{if .update}}{{if eq 0 .Messages.Type}}selected="selected"{{end}}{{else}}{{if eq 0 .Type}}selected="selected"{{end}}{{end}} value="0">留言</option>
                    <option {{if .update}}{{if eq 1 .Messages.Type}}selected="selected"{{end}}{{else}}{{if eq 1 .Type}}selected="selected"{{end}}{{end}} value="1">私信</option>
                    <option {{if .update}}{{if eq 2 .Messages.Type}}selected="selected"{{end}}{{else}}{{if eq 2 .Type}}selected="selected"{{end}}{{end}} value="2">积分消息</option>
                    <option {{if .update}}{{if eq 3 .Messages.Type}}selected="selected"{{end}}{{else}}{{if eq 3 .Type}}selected="selected"{{end}}{{end}} value="3">文章评论</option>
                    <option {{if .update}}{{if eq 4 .Messages.Type}}selected="selected"{{end}}{{else}}{{if eq 4 .Type}}selected="selected"{{end}}{{end}} value="4">文章收藏</option>
                    <option {{if .update}}{{if eq 5 .Messages.Type}}selected="selected"{{end}}{{else}}{{if eq 5 .Type}}selected="selected"{{end}}{{end}} value="5">订单消息</option>
                </select>
            </div>
        </div>
		<div class="form-group col-md-12">
            <label class="col-md-3 control-label">状态：</label>
            <div class="col-md-9">
                <select class="form-control m-b" name="MesageStatus">
                    <option {{if .update}}{{if eq 0 .Messages.MesageStatus}}selected="selected"{{end}}{{end}} value="0">未读</option>
                    <option {{if .update}}{{if eq 1 .Messages.MesageStatus}}selected="selected"{{end}}{{end}} value="1">已读</option>
                </select>
            </div>
        </div>
		<input type="hidden" value="{{if .update}}{{.Messages.Addonfileds1}}{{end}}" name="Addonfileds1">
		<input type="hidden" value="{{if .update}}{{.Messages.Addonfileds2}}{{end}}" name="Addonfileds2">
		<input type="hidden" value="{{if .update}}{{.Messages.Addonfileds3}}{{end}}" name="Addonfileds3">
		<input type="hidden" value="{{if .update}}{{.Messages.Addonfileds4}}{{end}}" name="Addonfileds4">
		
    	<div class="form-group col-md-12">
            <div class="col-md-12 col-md-offset-3">
                <button class="btn btn-primary" type="submit">保存内容</button>
                {{if .update}}{{else}}
                <button class="btn btn-white" type="submit">取消</button>
                {{end}}
            </div>
        </div>
    </div>
</form>



<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/jquery.uploadify.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="/js/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/ueditor.all.min.js"></script>
<script type="text/javascript" src="/lang/zh-cn/zh-cn.js"></script>
<script src="/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/js/plugins/validate/messages_zh.min.js"></script>


<!-- jQuery UI -->
<script src="/js/jquery-ui-1.10.4.min.js"></script>
<!-- laydate js -->
<script src="/js/plugins/layer/laydate/laydate.js"></script>

<!--form validate-->
<script>
    $().ready(function () {
        // validate the comment form when it is submitted
        $("#FORM_validate").validate({
            rules: {
                SendId:{
                    required:true,
                    digits:true
                },
                ReceiveId:{
                    required:true,
                    digits:true
                },
            }
        });
    });
</script>




</body>
</html>